package com.banmoon.adapter.objmode;

import cn.hutool.core.util.StrUtil;

public class Electricity220VTo5VAdapter implements ElectricityAdapter{

    private Electricity220V electricity220V;

    public Electricity220VTo5VAdapter(Electricity220V electricity220V) {
        this.electricity220V = electricity220V;
    }

    @Override
    public int transform() {
        int voltage = electricity220V.output();
        int newVoltage = voltage - 215;
        System.out.println(StrUtil.format("成功：已将{}V转化为{}V", voltage, newVoltage));
        System.out.println(StrUtil.format("输出电压：{}V", newVoltage));
        return newVoltage;
    }
}
